{% load static %}

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>投票 | {{ question.question_text }}</title>
    <link rel="stylesheet" href="{% static 'polls/style.css' %}">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
    <div class="poll-container vote-container">
        <header class="poll-header">
            <h1><span class="icon">✏️</span> 请投票</h1>
            <p class="subtitle">{{ question.question_text }}</p>
        </header>

        <form action="{% url 'polls:vote' question.id %}" method="post" class="vote-form">
            {% csrf_token %}
            
            {% if error_message %}
            <div class="error-message">
                <span class="icon">⚠️</span> {{ error_message }}
            </div>
            {% endif %}

            <div class="choices-list">
                {% for choice in question.choice_set.all %}
                <label class="choice-item">
                    <input type="radio" name="choice" value="{{ choice.id }}" class="choice-radio">
                    <span class="custom-radio"></span>
                    <span class="choice-text">{{ choice.choice_text }}</span>
                </label>
                {% endfor %}
            </div>

            <div class="form-footer">
                <button type="submit" class="btn btn-submit">
                    <span class="icon">✓</span> 提交投票
                </button>
                <a href="{% url 'polls:index' %}" class="btn btn-back">
                    <span class="icon">←</span> 返回列表
                </a>
                <a href="http://119.23.145.136:8000/admin/" class="btn btn-admin">
                    <span class="icon">⚙️</span> 管理后台
                </a>
            </div>
        </form>
    </div>
</body>
</html>